<form>
	<table class="table table-hover">
		<thead>
			<tr>
				<th>ID</th>
				<th>活动名称</th>
				<th>活动描述</th>
				<th>活动标记</th>
				<th>状态</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
			<foreach name="itemLists" item="vo">
				<tr>
					<td>{$vo.id}</td>
					<td>{$vo.name}</td>
					<td>{$vo.description}</td>
					<td>{$vo.tag}</td>
					<td class="status">
						{$vo["status"]?"启用":"停用"}
					</td>
					<td>
						<a class="btn btn-primary btn-xs" href="__CONTROLLER__/modify/id/{$vo.id}">修改</a>
						<a class="btn btn-info btn-xs action-status" data-action-id="{$vo.id}" data-action-txt="执行中……" data-action-status="{$vo.status}" data-action-status-txt="启用 停用" data-action-url="__CONTROLLER__/setStatus">{$vo["status"]?"停用":"启用"}</a>
						<a class="btn btn-danger btn-xs actionds" data-action-id="{$vo.id}" data-action-txt="移除中……" data-action-url="__CONTROLLER__/remove">移除</a>
					</td>
				</tr>
			</foreach>
		</tbody>
	</table>
	<div class="pagination">{$pagination}</div>

	<script type="text/javascript">
		$(function() {
			$(".table").delegate(".audit", "change", function() {
				var status = $(this).val(),
					id = $(this).attr("data-id");
				$.post("__CONTROLLER__/setStatus", {
					"id": id,
					"status": status
				}, function(data) {
					if (data.error) {
						$().alertMsg({
							"type": "error",
							"msg": data.msg
						});
					} else {
						$().alertMsg({
							"type": "success",
							"msg": data.msg
						});
					};
				});
			});
		});
	</script>
